home *** CD-ROM | disk | FTP | other *** search
/ Scene 96 / Scene 96 International Edition (Zyklop Software) (Disc 2) (1997).iso / misc / coding / dos32xtn / bugfix / src / libdos32 / libc / dos32 / noexcept.s < prev   
Encoding:
Text File  |  1996-10-05  |  2.0 KB  |  97 lines

  1. /*
  2.  this file was changed or created for the DOS32 library for DJGPP on 5.10.1996
  3.  new created files are copyright 1996 by C.Lageman, see docs.doc for details
  4. */
  5. /*
  6.    This file is the same like exceptn.s - only without exception handlers
  7.  
  8. */
  9.         .file "noexcept.s"
  10.         .text
  11.  
  12.  
  13. /*
  14.       bios ctrl-break
  15. */
  16. int1b:
  17.       pushl    %ds
  18.       cs
  19.       movw     ___dos32_ds,%ds
  20.       testb    $1,___dos32_cbreak_mode
  21.       jz       cbreak_exit
  22.       testb    $2,___dos32_cbreak_mode
  23.       jz       1f
  24.       movb     $1,___dos32_cbreak_counter
  25. 1:
  26.       popl     %ds
  27.       iret
  28.  
  29. cbreak_exit:
  30.       movl     $cbreakmsg,%ecx
  31.       movb     $6,%ah
  32. 1:
  33.       movb     (%ecx),%dl
  34.       orb      %dl,%dl
  35.       jz       2f
  36.       incl     %ecx
  37.       int      $0x21
  38.       jmp      1b
  39. 2:    movw     $0x4c01,%ax
  40.       int      $0x21
  41. /*
  42.       dos ctrl-c / ctrl - break
  43.       this is faked by just using the identical int1b handler
  44. int23:
  45.       jmp      int1b
  46. */
  47.  
  48. /*
  49.       critical error handler with 3 retries (remove retrys ?)
  50. */
  51. int24:
  52.         testb   $0x80,%ah
  53.         jnz     fail_int24
  54.         pushl   %ds
  55.         pushl   %esi
  56.         cs
  57.         movw    ___dos32_ds,%ds
  58.         cmpb    errordrive,%al
  59.         movl    $error_retries,%esi
  60.         je      1f
  61.         movb    %al,errordrive
  62.         movb    $0,(%esi)
  63. 1:      incb    (%esi)
  64.         cmpb    $3,(%esi)
  65.         popl    %esi
  66.         popl    %ds
  67.         ja      fail_int24
  68.         movb    $1,%al
  69.         clc
  70.         lret
  71. fail_int24:
  72.         movb    $3,%al
  73.         clc
  74.         lret
  75.  
  76.         .data
  77. errordrive:
  78.         .byte   0xff
  79.         .lcomm  error_retries,1
  80.  
  81. cbreakmsg:
  82.         .ascii  "Exit due to <CTRL-BREAK>"
  83.         .byte   13,10,0
  84.  
  85.         .global ___dos32_new_ints
  86. ___dos32_new_ints:
  87.         .byte   0x1b
  88.         .long   int1b
  89.         .byte   0x23
  90.         .long   int1b
  91.         .byte   0x24
  92.         .long   int24
  93.         .byte   0xff
  94. /*
  95. ************************* end of noexcept.s **********************************
  96. */
  97.